//
//  main.m
//  类型通配符
//
//  Created by 李煜 on 2023/9/12.
//

#import <Foundation/Foundation.h>

#import "MyArray.h"
int main(int argc, const char * argv[]) {
    @autoreleasepool {

        MyArray<NSString*> *arr = [[MyArray alloc]init];

        [arr addObj:@"i "];
        [arr addObj:@"love "];
        [arr addObj:@"you "];

        NSLog(@"%@",arr);

        //协变和逆变
        MyArray<NSString*> * superArr1;
        MyArray<NSMutableString*> * baseArr2;

        superArr1 = baseArr2;

//        baseArr2 = superArr1; 若使用逆变请标记MyArray contravariant
    }
    return 0;
}
